﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestMatrix.Model
{
    public class tblTestAutomation : INotifyPropertyChanged, INotifyPropertyChanging
    {
        public tblTestAutomation()
        {
           
        }

        public tblTestAutomation(
            int id
            , string application
            , string createdDate
            , int totalTestCases
            , int automatable
            , int cannotAutomated
            , int automatableNotReady
            , int alreadyAutomated
            , int gap
            , int rateAlreadyAutomated
            , int rateAutomatable
            , int linesOfAutomationCode
            )
        {
            this.ID = id;
            this.Application = application;
            this.CreatedDate = createdDate;
            this.TotalTestCases = totalTestCases;
            this.Automatable = automatable;
            this.CannotAutomated = cannotAutomated;
            this.AutomatableNotReady = automatableNotReady;
            this.AlreadyAutomated = alreadyAutomated;
            this.Gap = gap;
            this.RateAlreadyAutomated = rateAlreadyAutomated;
            this.RateAutomatable = rateAutomatable;
            this.LinesOfAutomationCode = linesOfAutomationCode;
        }

        private int _ID;

        public int ID
        {
            get { return _ID; }
            set
            {
                if (_ID != value)
                {
                    NotifyPropertyChanging("ID");
                    _ID = value;
                    NotifyPropertyChanged("ID");
                }
            }

        }
        
        private string _Application;

        public string Application
        {
            get { return _Application; }
            set
            {
                if (_Application != value)
                {
                    NotifyPropertyChanging("Application");
                    _Application = value;
                    NotifyPropertyChanged("Application");
                }
            }
        }

        private string _CreatedDate;

        public string CreatedDate
        {
            get { return _CreatedDate; }
            set
            {
                if (_CreatedDate != value)
                {
                    NotifyPropertyChanging("CreatedDate");
                    _CreatedDate = value;
                    NotifyPropertyChanged("CreatedDate");
                }
            }
        }

        private int _TotalTestCases;

        public int TotalTestCases
        {
            get { return _TotalTestCases; }
            set
            {
                if (_TotalTestCases != value)
                {
                    NotifyPropertyChanging("TotalTestCases");
                    _TotalTestCases = value;
                    NotifyPropertyChanged("TotalTestCases");
                }
            }

        }

        private int _Automatable;

        public int Automatable
        {
            get { return _Automatable; }
            set
            {
                if (_Automatable != value)
                {
                    NotifyPropertyChanging("Automatable");
                    _Automatable = value;
                    NotifyPropertyChanged("Automatable");
                }
            }

        }

        private int _CannotAutomated;

        public int CannotAutomated
        {
            get { return _CannotAutomated; }
            set
            {
                if (_CannotAutomated != value)
                {
                    NotifyPropertyChanging("CannotAutomated");
                    _CannotAutomated = value;
                    NotifyPropertyChanged("CannotAutomated");
                }
            }

        }

        private int _AutomatableNotReady;

        public int AutomatableNotReady
        {
            get { return _AutomatableNotReady; }
            set
            {
                if (_AutomatableNotReady != value)
                {
                    NotifyPropertyChanging("AutomatableNotReady");
                    _AutomatableNotReady = value;
                    NotifyPropertyChanged("AutomatableNotReady");
                }
            }

        }

        private int _AlreadyAutomated;

        public int AlreadyAutomated
        {
            get { return _AlreadyAutomated; }
            set
            {
                if (_AlreadyAutomated != value)
                {
                    NotifyPropertyChanging("AlreadyAutomated");
                    _AlreadyAutomated = value;
                    NotifyPropertyChanged("AlreadyAutomated");
                }
            }

        }

        private int _Gap;

        public int Gap
        {
            get { return _Gap; }
            set
            {
                if (_Gap != value)
                {
                    NotifyPropertyChanging("Gap");
                    _Gap = value;
                    NotifyPropertyChanged("Gap");
                }
            }

        }

        private int _RateAlreadyAutomated;

        public int RateAlreadyAutomated
        {
            get { return _RateAlreadyAutomated; }
            set
            {
                if (_RateAlreadyAutomated != value)
                {
                    NotifyPropertyChanging("RateAlreadyAutomated");
                    _RateAlreadyAutomated = value;
                    NotifyPropertyChanged("RateAlreadyAutomated");
                }
            }

        }

        private int _RateAutomatable;

        public int RateAutomatable
        {
            get { return _RateAutomatable; }
            set
            {
                if (_RateAutomatable != value)
                {
                    NotifyPropertyChanging("RateAutomatable");
                    _RateAutomatable = value;
                    NotifyPropertyChanged("RateAutomatable");
                }
            }

        }

        private int _LinesOfAutomationCode;

        public int LinesOfAutomationCode
        {
            get { return _LinesOfAutomationCode; }
            set
            {
                if (_LinesOfAutomationCode != value)
                {
                    NotifyPropertyChanging("LinesOfAutomationCode");
                    _LinesOfAutomationCode = value;
                    NotifyPropertyChanged("LinesOfAutomationCode");
                }
            }

        }

        public event PropertyChangedEventHandler PropertyChanged;

        // Used to notify that a property changed
        private void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        // Used to notify that a property is about to change
        private void NotifyPropertyChanging(string propertyName)
        {
            if (PropertyChanging != null)
            {
                PropertyChanging(this, new PropertyChangingEventArgs(propertyName));
            }

        }
    }
}
